<html>
<script type = "text/javascript" src = "./numeric-1.2.6.js"> </script>
<title> nothing </title>
<h1> test </h1>
<body>
    </hr>
    input your data:
    </br>
    <form>
        atom number : <input type = "text" id = "text1" value = "5">
        <input type = "button" id = "btn1" onclick = "getdensity()" value = "calc density by Atom number">
        </br>
        laser intensity in W/cm2: <input type = "text" id = "text2" value = "1e24">
        </br>
        laser wavelength in um: <input type = "text" id = "text3" value = "1.06">
        <input type = "button" id = "btn2" onclick = "getintensity()" value = "calc field intensity">
        </br>
    </form>


    <script type = "text/javascript" language="javascript">
// some physical constants will be defined here
var c_light = 3e8
var Na = 6.02e23
var alpha = 1.0/137
var PI = 3.14159265453
var eV = 1.6e-19
var KeV = 1000 * eV
var MeV = 1e6 * eV
var GeV = 1e9 * eV
var me = 9.1e-31
var mc2 = me * c_light * c_light
var hbar = 6.626e-34 /(2.0 * PI)
var r0 = 2.818e-15
var alpha = 1/137.0
var lambdah = hbar / (me*c_light)
var lambdacompton = lambdah
var mb = 1e-31

var epsilon_0 = 8.854187187e-12
var mu_0 = 1.256637061e-6

function calc()
{
		var num = getbyid("text1")
        alert(" input " + num)
		print("i have inputed " + num)
		print("log " + num + " = " + Math.log(num))
}

function print(obj)
{
	document.write(obj + "</br>")
}

function getbyid(id)
{
	return document.getElementById(id).value
}

function getrho(atom)
{
	var rhos = new Array(0.09, 0.18, 0.53, 1.85, 2.34, 2.26, 1.25, +
	1.43, 1.7, 0.9, 0.97, 1.74, 2.7, 2.33, 1.82, 2.07, 3.21, 1.78, 0.86, +
	1.55, 2.99, 4.54, 6.11, 7.19, 7.43, 7.87, 8.9, 8.9, 8.96, 7.13, +
	5.91, 5.32, 5.72, 4.79, 3.12, 3.75, 1.63, 2.54, 4.47, 6.51, 8.57, 10.22, +
	11.5, 12.37, 12.41, 12.02, 10.5, 8.65, 7.31, 7.31, 6.68, 6.24, 4.93, +
	5.9, 1.87, 3.59, 6.15, 6.77, 6.77, 7.01, 7.3, 7.52, 5.24, 7.9, 8.23, 8.55, +
	8.8, 9.07, 9.32, 6.9, 9.84, 13.31, 16.65, 19.35, 21.04, 22.6, 22.4, 21.45, +
	19.32, 13.55)
	return rhos[atom]
	
}


function getna(atom)
{
	var atomwt = new Array(1.0079, 4.0026, 6.941, 9.0122, 10.811,  12.0107, +
	14.0067, 15.9994, 18.9984, 20.1797, 22.9897, 24.305, 26.9815, 28.0855, +
	30.9738, 32.065, 35.453, 39.948, 39.0983, 40.078, 44.9559, 47.867, 50.9415, +
	51.9961,  54.938,  55.845, 58.9332,  58.6934, 63.546, 65.39, 69.723, 72.64, +
	74.9216,  78.96, 79.904, 83.8, 85.4678, 87.62, 88.9059, 91.224, 92.9064, +
	95.94, 98, 101.07, 102.9055, 106.42, 107.8682, 112.411, 114.818, 118.71, +
	121.76, 127.6, 126.9045, 131.293, 132.9055, 137.327, 138.9055, 140.116, +
	140.9077, 144.24, 145, 150.36, 151.964, 157.25, 158.9253, 162.5, 164.9303, +
	167.259, 168.9342, 173.04, 174.967, 178.49, 180.9479, 183.84, 186.207, +
	190.23, 192.217, 195.078, 196.9665, 200.59)
	return atomwt[atom]
}

function getdensity()
{
	var atom = getbyid("text1")
	if(atom < 1 || atom > 90)
	{
		alert("please reset atom number between 1- 80")
		return
	}
	var rho = getrho(atom - 1)
	print("rho = " + rho)
	var naa = getna(atom - 1)
	print("na = " + naa)
	var density = rho / naa * Na
	print("density = " + density)
	print("omega pe = " + omega(density))
}


function omega(density)
{
	return density * eV*eV / me / epsilon_0
}


function getintensity()
{
	var intens = getbyid("text2")
	var lambda = getbyid("text3")
	print("intensity = " + intens)
	var efield = Math.sqrt(2.0 * intens * 1e4 / c_light / epsilon_0)
	var omega = c_light / lambda * 1e6
	print("efield = " + efield)
	print("omega = "+omega)
}




    </script>






</body>

</html>

